package com.vivz.baby.rest.service;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.vivz.baby.util.SysoutUtil;

/**
 * Log Rest Service
 *
 * @author Vivek More
 */
@RestController
@RequestMapping("/**")
public class DefaultService {

	@RequestMapping
	public String returnDefaultResponse() {
		SysoutUtil.sysout(this.getClass(), "returnDefaultResponse()");
		return "You have rubbed me the wrong way Buddy ! \n";
	}

	@RequestMapping(method = RequestMethod.POST)
	public String returnDefaultResponse(@RequestBody final Object... objects) {
		SysoutUtil.sysout(this.getClass(), "returnDefaultResponse(objects)", objects);
		return "What am I supposed to do with this:\n" + ToStringBuilder.reflectionToString(objects, ToStringStyle.SHORT_PREFIX_STYLE);
	}
}
